SET QUOTED_IDENTIFIER ON
GO
SET ANSI_NULLS ON
GO
CREATE PROCEDURE [dbo].[usp_AddNewCollege]
    (
      @fdCollID VARCHAR(50),
      @fdCollName VARCHAR(50),
      @fdCollIntroduction NTEXT,
      @fdCollAddID VARCHAR(50)
    )
AS 
    DECLARE @Count INT
    SET @Count = (
                   SELECT   COUNT(fdCollID)
                   FROM     dbo.FS_College
                   WHERE    fdCollID = @fdCollID
                 )
    IF @Count = 0 
        BEGIN
            INSERT  INTO dbo.FS_College ( fdCollID , fdCollName )
            VALUES  (
                      @fdCollID, -- fdCollID - varchar(50)
                      @fdCollName  -- fdCollName - varchar(50)
                    )
            INSERT  INTO dbo.JOL_CollegeIntroduction
                    (
                      fdCollID,
                      fdCollIntroduction,
                      fdCollAddTime,
                      fdCollAddID,
                      fdCollVerifyStatus,
                      fdCollVerifyTime,
                      fdCollVerifyID
                    )
            VALUES  (
                      @fdCollID, -- fdCollID - varchar(50)
                      @fdCollIntroduction, -- fdCollIntroduction - ntext
                      GETDATE(), -- fdCollAddTime - datetime
                      @fdCollAddID, -- fdCollAddID - varchar(50)
                      0, -- fdCollVerifyStatus - bit
                      NULL, -- fdCollVerifyTime - datetime
                      NULL  -- fdCollVerifyID - varchar(50)
                    )
        END
    ELSE 
        SELECT  '已存在相同编号的院系，不能再添加' 
GO
